package cn.iocoder.yudao.module.ym.dal.mysql.ticketlog;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ym.dal.dataobject.ticketlog.TicketLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ym.controller.admin.ticketlog.vo.*;

/**
 * 工单日志 Mapper
 *
 * @author 韩艳阳
 */
@Mapper
public interface TicketLogMapper extends BaseMapperX<TicketLogDO> {

    default PageResult<TicketLogDO> selectPage(TicketLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TicketLogDO>()
                .betweenIfPresent(TicketLogDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(TicketLogDO::getStatus, reqVO.getStatus())
                .eqIfPresent(TicketLogDO::getRemark, reqVO.getRemark())
                .eqIfPresent(TicketLogDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(TicketLogDO::getTicketId, reqVO.getTicketId())
                .eqIfPresent(TicketLogDO::getContent, reqVO.getContent())
                .orderByAsc(TicketLogDO::getId));
    }

}